package com.example.springboot.controller;

import com.example.springboot.common.Result;
import com.example.springboot.entity.PopulationStatistics;
import com.example.springboot.service.ProcreateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 功能：生育接口
 * 作者：陈雷
 * 日期：2024/11/17 18:18
 */

@RestController
@CrossOrigin
@RequestMapping("/procreate")
public class ProcreateController {
    @Autowired
    ProcreateService procreateService;

    //返回对应年份以及出生人口数据
    @RequestMapping("/selectAll")
    public Result selectAll(){
        List<PopulationStatistics> result = procreateService.selectAll();
        return Result.success(result);
    }

}